<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>控制台</title>
		<link rel="stylesheet" type="text/css" href="../public/Css/identify.css" />
		<link rel="stylesheet" type="text/css" href="../public/Css/layout.css" />
		<link rel="stylesheet" type="text/css" href="../public/account.css" />
		<link rel="stylesheet" type="text/css" href="../public/Css/style.css" />
		<link rel="stylesheet" type="text/css" href="../public/Css/control_index.css" />
		<script type="text/javascript" src="../public/Js/jquery-1.7.2.min.js"></script>
		<script type="text/javascript" src="../public/layer/layer.js"></script>
		<script type="text/javascript" src="../public/Js/haidao.offcial.general.js"></script>
		<script type="text/javascript" src="../public/Js/select.js"></script>
		<script type="text/javascript" src="../public/Js/haidao.validate.js"></script>
		<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
		<link rel="stylesheet" href="../public/Css/bootstrap.min.css">
		<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
		<script src="../public/Css/bootstrap.min.js"></script>
	</head>

	<body>
	<?php include "../view/left1.html";?>

	<div class="view-product">
				<div class="manage account-manage">
					<div class="manage-head">
						<h6 class="layout padding-left manage-head-con">文章管理</h6>
					</div>
					<table class="table table-hover" style="width: 80% ;margin: 0 auto">
						<thead>
						<tr>
							<th>文章名称</th>
							<th>所属分类</th>
							<th>发布时间</th>
                            <th>发布人</th>
							<th>评论</th>
							<th>操作</th>
						</tr>
						</thead>
						<tbody>
						<?php foreach($art_row as $vaue):?>
						<?php
							$art_id =  $vaue['art_id'];
							$dis_sql = "select  count(*) as num from discuss where art_id = $art_id";
							$num=$dao->fetchRow($dis_sql);
						?>
						<tr>
							<td><?php echo $vaue['art_title'];?></td>
							<td><?php echo $vaue['col_content'];?></td>
							<td><?php echo date('Y-m-d H:i:s',$vaue['aer_time'])?></td>
							<td><?php echo $vaue['user_name'];?></td>
							<td><a href=""><?php echo$num['num'];?></a></td>
							<td><a style="cursor:pointer"  name="dle_article_delete.php?art_id=<?php echo $vaue['art_id'];?>"onclick =delect(this.name)>删除</a> / <a href="editors.php?art_id=<?php echo $vaue['art_id'];?> ">编辑</a></td>
						</tr>
						<?php endforeach?>
						<tr>
							<td  colspan="6">
								<div style=""><?php echo $page->create();?></div>
							</td>
						</tr>
						</tbody>
					</table>

				</div>
			</div>
		<script>
			$(".sidebar-title").live('click', function() {
				if ($(this).parent(".sidebar-nav").hasClass("sidebar-nav-fold")) {
					$(this).next().slideDown(200);
					$(this).parent(".sidebar-nav").removeClass("sidebar-nav-fold");
				} else {
					$(this).next().slideUp(200);
					$(this).parent(".sidebar-nav").addClass("sidebar-nav-fold");
				}
			});
		</script>
		<script>
			function delect(url) {
				if(confirm("确定要删除吗，此操作将会把文章和文章关联的评论一起删除？ ")){				//输出选择框，用户可以单击“确认”或“取消”按钮
					window.open(url,'_parent','',false);	//如果用户确认退出，则打开logout.php页
				}else{
						return false;
				}
			}
		</script>
	</body>

</html>